import request from '@/config/axios'

// 门店设置 VO
export interface SystemVO {
  id: number // 编号
  switchs: number // 门店切换
  confirmWindows: number // 门店确认弹窗
  separateAccountingIncome: number // 门店收益单独核算
}

// 门店设置 API
export const SystemApi = {
  // 查询门店设置分页
  getSystemPage: async (params: any) => {
    return await request.get({ url: `/store/system/page`, params })
  },

  // 查询门店设置详情
  getSystem: async (id: number) => {
    return await request.get({ url: `/store/system/get?id=` + id })
  },

  // 新增门店设置
  createSystem: async (data: SystemVO) => {
    return await request.post({ url: `/store/system/create`, data })
  },

  // 修改门店设置
  updateSystem: async (data: SystemVO) => {
    return await request.put({ url: `/store/system/update`, data })
  },

  // 删除门店设置
  deleteSystem: async (id: number) => {
    return await request.delete({ url: `/store/system/delete?id=` + id })
  },

  // 导出门店设置 Excel
  exportSystem: async (params) => {
    return await request.download({ url: `/store/system/export-excel`, params })
  },
}
